<!--
    This Source Code Form is subject to the terms of the Mozilla Public
    License, v. 2.0. If a copy of the MPL was not distributed with this
    file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->

<!--
    Copyright 2019 Joyent, Inc.
-->

<div class="page-header">
  <div class="resource-status">
    {{#if active}}
    <span class="active">ACTIVE</span>
    {{else}}
    <span class="inactive">INACTIVE</span>
    {{/if}}
  </div>
  <h2>
    Package
    {{name}} {{version}} {{#if group}} &nbsp;<small>{{group}}</small>{{/if}}
  </h2>
</div>

{{#role "operators"}}
<div class="actions pull-right">
  <div class="notes-component-container"></div>
  <button class="btn btn-info traits"><i class="fa fa-pencil"></i> Traits</button>
  <button class="btn btn-info change-owner"><i class="fa fa-pencil"></i> Modify Package</button>
</div>
{{/role}}

<div class="row">
<div class="package-versions-region col-sm-3"></div>

<div class="package-details col-sm-9">

  {{#if description}}
  <div class="description">{{description}}</div>
  {{/if}}

  {{#if owner_uuids}}
  <div class="owner">
    <strong>Owners</strong>
    <div class="owners">
      {{#each owner_uuids}}
      <div class="value">
        <a class="login" data-uuid="{{this}}"></a>
        <div class="uuid">{{this}}</div>
      </div>
      {{/each}}
    </div>
  </div>
  {{/if}}

  <h3>Memory &amp; CPU</h3>

  <div class="memory">
    <strong>RAM</strong>
    <div class="value">{{normalize max_physical_memory}}</div>
  </div>

  {{#if vcpus}}

  <div class="vcpus">
    <strong>VCPUs</strong>
    <div class="value">{{vcpus}}</div>
  </div>

  {{/if}}

  <div class="swap">
    <strong>Swap</strong>
    <div class="value">{{max_swap}} MB</div>
  </div>

  <div class="cpu-cap">
    <strong>CPU Cap (% CPU)</strong>
    <div class="value">{{cpu_cap}}</div>
  </div>

  <div class="max-processes">
    <strong>Max Lightweight Processes</strong>
    <div class="value">{{max_lwps}}</div>
  </div>


  <h3>Storage</h3>
  <div class="quota">
    <strong>Disk Quota</strong>
    <div class="value">{{normalize quota}}</div>
  </div>

  <div class="io-priority">
    <strong>ZFS IO Priority</strong>
    <div class="value">{{zfs_io_priority}}</div>
  </div>

  <h3>Optional Settings</h3>
  <div class="brand">
    <strong>Brand</strong>
    <div class="value">{{brand}}</div>
  </div>

  {{#ifeq brand "bhyve"}}
  <div class="flexible-disk">
    <strong>Flexible disk</strong>
    <div class="value">{{flexible_disk}}</div>
  </div>


  {{#if disks}}
  <div class="disks">
    <h4>Disks</h4>
    <div class="disk-size">
      {{#each disks}}
        <strong>Size</strong>
        {{#if this.size}}
        <div class="value">{{this.size}}</div>
        {{else}}
        <div class="value">OS disk (size set by image)</div>
        {{/if}}
        <br />
      {{/each}}
    </div>
  </div>
  {{/if}}
  {{/ifeq}}

  <section class="networks">
    <h3>Networks</h3>
    <div class="networks-list"></div>
    <div class="network-pools-list"></div>
  </section>

  <section>
  <h3>Billing</h3>

  <div class="billing-id">
    <strong>Billing ID</strong>
    <div class="value">{{uuid}}</div>
  </div>
  </section>
</div>
</div>
